﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Thingpower.SS.AliyunSMS.Models;

namespace Thingpower.SS.AliyunSMS.Core
{
    public class Utils
    {
        public static PluginConfigInfo GetConfig()
        {
            return AliyunSMSPlugin.Instance.ConfigApi.GetConfig<PluginConfigInfo>(0) ?? new PluginConfigInfo();
        }

        public static string GetMessageHtml(string message, bool isSuccess)
        {
            return isSuccess
                ? $@"<div class=""alert alert-success"" role=""alert"">{message}</div>"
                : $@"<div class=""alert alert-danger"" role=""alert"">{message}</div>";
        }
    }
}